﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<UserControl x:Class="System.Windows.Controls.Samples.AccordionSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
    xmlns:system="clr-namespace:System;assembly=mscorlib">
  <StackPanel>
    <ContentControl Content="Accordion" Style="{StaticResource Header}" />

    <Grid Background="White" Width="600" Height="700">
      <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition />
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions >
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
      </Grid.RowDefinitions>

      <layoutToolkit:Accordion x:Name="acc" Grid.Column="0" >
        <layoutToolkit:AccordionItem Content="item 1" Header="A"  />
        <layoutToolkit:AccordionItem Content="item 2" Header="B -  long header" />
        <system:String>regular string item 3</system:String>
      </layoutToolkit:Accordion>

      <Grid Grid.Column="1" Grid.RowSpan="2" VerticalAlignment="Top" Margin="40,0,0,0" Height="400">
        <Grid.ColumnDefinitions>
          <ColumnDefinition />
          <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBlock Text="Selection Mode" Grid.Column="0" Grid.Row="0" Margin="4" />
        <ComboBox x:Name="cbSelectionMode" 
                  Grid.Column="1"
                  Grid.Row="0"
                  SelectionChanged="SelectionModeChanged" 
                  Margin="4" >
          <ComboBoxItem Content="One" />
          <ComboBoxItem Content="OneOrMore" />
          <ComboBoxItem Content="ZeroOrOne" />
          <ComboBoxItem Content="ZeroOrMore" />
        </ComboBox>

        <TextBlock Text="Expand Direction" Grid.Column="0" Grid.Row="1" Margin="4" />
        <ComboBox x:Name="cbExpandDirection" 
                  Grid.Column="1"
                  Grid.Row="1"
                  SelectionChanged="ExpandDirectionChanged" 
                  Margin="4" >
          <ComboBoxItem Content="Up" />
          <ComboBoxItem Content="Down" />
          <ComboBoxItem Content="Left" />
          <ComboBoxItem Content="Right" />
        </ComboBox>


        <TextBlock Text="Sequence:" Grid.Column="0" Grid.Row="2" Margin="4" />
        <ComboBox x:Name="cbSelectionSequence" 
                  Grid.Column="1"
                  Grid.Row="2"
                  SelectionChanged="SelectionSequenceChanged" 
                  Margin="4">
          <ComboBoxItem Content="CollapseBeforeExpand" />
          <ComboBoxItem Content="Simultaneous" />
        </ComboBox>

        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="3">
          <Button Content="select all" Click="SelectAll" Margin="4" />
          <Button Content="unselect all" Click="UnselectAll" Margin="4" />
        </StackPanel>

        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="4">
          <Button Content="Set explicitHeight" Click="SetHeight" Margin="4"  />
          <Button Content="Remove explicitHeight" Click="RemoveHeight" Margin="4"  />
        </StackPanel>

        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="5">
          <Button Content="Set explicitWidth" Click="SetWidth" Margin="4"  />
          <Button Content="Remove explicitWidth" Click="RemoveWidth" Margin="4"  />
        </StackPanel>

        <TextBlock Text="Selected indices" Grid.Row="6" Margin="4" />
        <ItemsControl x:Name="icSelectedIndices" Margin="4" Grid.Column="1" Grid.Row="6" />

        <TextBlock Text="Selected index" Grid.Row="7" Margin="4" />
        <TextBox x:Name="tbSelectedIndex" Grid.Row="8" Grid.Column="1" Margin="4" />

      </Grid>
    </Grid>

    <src:SourceViewer xmlns:src="clr-namespace:System.Windows.Controls.Samples;assembly=System.Windows.Controls.Samples.Common" xmlns:sys="clr-namespace:System;assembly=mscorlib">
  <src:SourceFile Path="AccordionSample.xaml">
    <src:SourceFile.Source>
      <sys:String>&lt;!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
--&gt;

&lt;UserControl x:Class="System.Windows.Controls.Samples.AccordionSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
    xmlns:system="clr-namespace:System;assembly=mscorlib"&gt;
  &lt;StackPanel&gt;
    &lt;ContentControl Content="Accordion" Style="{StaticResource Header}" /&gt;

    &lt;Grid Background="White" Width="600" Height="700"&gt;
      &lt;Grid.ColumnDefinitions&gt;
        &lt;ColumnDefinition /&gt;
        &lt;ColumnDefinition /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;Grid.RowDefinitions &gt;
        &lt;RowDefinition Height="Auto" /&gt;
        &lt;RowDefinition Height="*" /&gt;
      &lt;/Grid.RowDefinitions&gt;

      &lt;layoutToolkit:Accordion x:Name="acc" Grid.Column="0" &gt;
        &lt;layoutToolkit:AccordionItem Content="item 1" Header="A"  /&gt;
        &lt;layoutToolkit:AccordionItem Content="item 2" Header="B -  long header" /&gt;
        &lt;system:String&gt;regular string item 3&lt;/system:String&gt;
      &lt;/layoutToolkit:Accordion&gt;

      &lt;Grid Grid.Column="1" Grid.RowSpan="2" VerticalAlignment="Top" Margin="40,0,0,0" Height="400"&gt;
        &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition /&gt;
          &lt;ColumnDefinition /&gt;
        &lt;/Grid.ColumnDefinitions&gt;
        &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
        &lt;/Grid.RowDefinitions&gt;

        &lt;TextBlock Text="Selection Mode" Grid.Column="0" Grid.Row="0" Margin="4" /&gt;
        &lt;ComboBox x:Name="cbSelectionMode" 
                  Grid.Column="1"
                  Grid.Row="0"
                  SelectionChanged="SelectionModeChanged" 
                  Margin="4" &gt;
          &lt;ComboBoxItem Content="One" /&gt;
          &lt;ComboBoxItem Content="OneOrMore" /&gt;
          &lt;ComboBoxItem Content="ZeroOrOne" /&gt;
          &lt;ComboBoxItem Content="ZeroOrMore" /&gt;
        &lt;/ComboBox&gt;

        &lt;TextBlock Text="Expand Direction" Grid.Column="0" Grid.Row="1" Margin="4" /&gt;
        &lt;ComboBox x:Name="cbExpandDirection" 
                  Grid.Column="1"
                  Grid.Row="1"
                  SelectionChanged="ExpandDirectionChanged" 
                  Margin="4" &gt;
          &lt;ComboBoxItem Content="Up" /&gt;
          &lt;ComboBoxItem Content="Down" /&gt;
          &lt;ComboBoxItem Content="Left" /&gt;
          &lt;ComboBoxItem Content="Right" /&gt;
        &lt;/ComboBox&gt;


        &lt;TextBlock Text="Sequence:" Grid.Column="0" Grid.Row="2" Margin="4" /&gt;
        &lt;ComboBox x:Name="cbSelectionSequence" 
                  Grid.Column="1"
                  Grid.Row="2"
                  SelectionChanged="SelectionSequenceChanged" 
                  Margin="4"&gt;
          &lt;ComboBoxItem Content="CollapseBeforeExpand" /&gt;
          &lt;ComboBoxItem Content="Simultaneous" /&gt;
        &lt;/ComboBox&gt;

        &lt;StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="3"&gt;
          &lt;Button Content="select all" Click="SelectAll" Margin="4" /&gt;
          &lt;Button Content="unselect all" Click="UnselectAll" Margin="4" /&gt;
        &lt;/StackPanel&gt;

        &lt;StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="4"&gt;
          &lt;Button Content="Set explicitHeight" Click="SetHeight" Margin="4"  /&gt;
          &lt;Button Content="Remove explicitHeight" Click="RemoveHeight" Margin="4"  /&gt;
        &lt;/StackPanel&gt;

        &lt;StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="5"&gt;
          &lt;Button Content="Set explicitWidth" Click="SetWidth" Margin="4"  /&gt;
          &lt;Button Content="Remove explicitWidth" Click="RemoveWidth" Margin="4"  /&gt;
        &lt;/StackPanel&gt;

        &lt;TextBlock Text="Selected indices" Grid.Row="6" Margin="4" /&gt;
        &lt;ItemsControl x:Name="icSelectedIndices" Margin="4" Grid.Column="1" Grid.Row="6" /&gt;

        &lt;TextBlock Text="Selected index" Grid.Row="7" Margin="4" /&gt;
        &lt;TextBox x:Name="tbSelectedIndex" Grid.Row="8" Grid.Column="1" Margin="4" /&gt;

      &lt;/Grid&gt;
    &lt;/Grid&gt;
  &lt;/StackPanel&gt;
&lt;/UserControl&gt;
</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
  <src:SourceFile Path="AccordionSample.xaml.cs">
    <src:SourceFile.Source>
      <sys:String>// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Windows.Data;
using System.Globalization;

namespace System.Windows.Controls.Samples
{
    /// &lt;summary&gt;
    /// Sample application for Accordion.
    /// &lt;/summary&gt;
    [Sample("Accordion Playaround sample", DifficultyLevel.Basic)]
    [Category("Accordion")]
    public partial class AccordionSample : UserControl
    {
        /// &lt;summary&gt;
        /// Initializes a new instance of the &lt;see cref="AccordionSample"/&gt; class.
        /// &lt;/summary&gt;
        public AccordionSample()
        {
            InitializeComponent();

            icSelectedIndices.SetBinding(
                ItemsControl.ItemsSourceProperty,
                new Binding("SelectedIndices") { Source = acc, Mode = BindingMode.OneWay });

            tbSelectedIndex.SetBinding(
                TextBox.TextProperty,
                new Binding("SelectedIndex") { Source = acc, Mode = BindingMode.TwoWay });

            acc.SetBinding(
                Accordion.SelectedIndexProperty,
                new Binding("Index") { Source = this, Mode = BindingMode.TwoWay });

            cbSelectionMode.SelectedItem = cbSelectionMode.Items
                .OfType&lt;ComboBoxItem&gt;()
                .FirstOrDefault(item =&gt; item.Content.Equals(acc.SelectionMode.ToString()));

            cbExpandDirection.SelectedItem = cbExpandDirection.Items
                .OfType&lt;ComboBoxItem&gt;()
                .FirstOrDefault(item =&gt; item.Content.Equals(acc.ExpandDirection.ToString()));

            cbSelectionSequence.SelectedItem = cbSelectionSequence.Items
                .OfType&lt;ComboBoxItem&gt;()
                .FirstOrDefault(item =&gt; item.Content.Equals(acc.SelectionSequence.ToString()));
        }

        /// &lt;summary&gt;
        /// Gets or sets the index.
        /// &lt;/summary&gt;
        /// &lt;value&gt;The index.&lt;/value&gt;
        public int Index
        {
            get { return index; }
            set
            {
                index = value;
                tbSelectedIndex.Text = value.ToString(CultureInfo.InvariantCulture);
            }
        }

        /// &lt;summary&gt;
        /// Backingfield for Index.
        /// &lt;/summary&gt;
        private int index;

        /// &lt;summary&gt;
        /// Expands the direction changed.
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;The sender.&lt;/param&gt;
        /// &lt;param name="e"&gt;The &lt;see cref="System.Windows.Controls.SelectionChangedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Hooked up in Xaml.")]
        private void ExpandDirectionChanged(object sender, SelectionChangedEventArgs e)
        {
            acc.ExpandDirection = (ExpandDirection)Enum.Parse(
                typeof(ExpandDirection),
                ((ComboBoxItem)cbExpandDirection.SelectedItem).Content.ToString(),
                true);
        }

        /// &lt;summary&gt;
        /// Sets the height.
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;The sender.&lt;/param&gt;
        /// &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Hooked up in Xaml.")]
        private void SetHeight(object sender, System.Windows.RoutedEventArgs e)
        {
            acc.Height = 500;
        }

        /// &lt;summary&gt;
        /// Removes the height.
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;The sender.&lt;/param&gt;
        /// &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Hooked up in Xaml.")]
        private void RemoveHeight(object sender, System.Windows.RoutedEventArgs e)
        {
            acc.ClearValue(Control.HeightProperty);
        }

        /// &lt;summary&gt;
        /// Selections the mode changed.
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;The sender.&lt;/param&gt;
        /// &lt;param name="e"&gt;The &lt;see cref="System.Windows.Controls.SelectionChangedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Hooked up in Xaml.")]
        private void SelectionModeChanged(object sender, SelectionChangedEventArgs e)
        {
            acc.SelectionMode = (AccordionSelectionMode)Enum.Parse(
                typeof(AccordionSelectionMode),
                ((ComboBoxItem)cbSelectionMode.SelectedItem).Content.ToString(),
                true);
        }

        /// &lt;summary&gt;
        /// Selects all.
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;The sender.&lt;/param&gt;
        /// &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Hooked up in Xaml.")]
        private void SelectAll(object sender, RoutedEventArgs e)
        {
            acc.SelectAll();
        }

        /// &lt;summary&gt;
        /// Unselects all.
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;The sender.&lt;/param&gt;
        /// &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Hooked up in Xaml.")]
        private void UnselectAll(object sender, RoutedEventArgs e)
        {
            acc.UnselectAll();
        }

        /// &lt;summary&gt;
        /// React to selectionSequence event.
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;The sender.&lt;/param&gt;
        /// &lt;param name="e"&gt;The &lt;see cref="System.Windows.Controls.SelectionChangedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Hooked up in Xaml.")]
        private void SelectionSequenceChanged(object sender, SelectionChangedEventArgs e)
        {
            acc.SelectionSequence = (SelectionSequence)Enum.Parse(
                typeof(SelectionSequence),
                ((ComboBoxItem)cbSelectionSequence.SelectedItem).Content.ToString(),
                true);
        }

        /// &lt;summary&gt;
        /// Removes the width.
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;The sender.&lt;/param&gt;
        /// &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by Xaml.")]
        private void RemoveWidth(object sender, RoutedEventArgs e)
        {
            acc.ClearValue(Control.WidthProperty);
        }

        /// &lt;summary&gt;
        /// Sets the width.
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;The sender.&lt;/param&gt;
        /// &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by Xaml.")]
        private void SetWidth(object sender, RoutedEventArgs e)
        {
            acc.Width = 300;
        }
    }
}
</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
  <src:SourceFile Path="AccordionSample.xaml.vb">
    <src:SourceFile.Source>
      <sys:String>' (c) Copyright Microsoft Corporation.
' This source is subject to the Microsoft Public License (Ms-PL).
' Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
' All other rights reserved.

Imports Microsoft.VisualBasic
Imports System.ComponentModel
Imports System.Linq
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System
Imports System.Globalization

''' &lt;summary&gt;
''' Sample application for Accordion.
''' &lt;/summary&gt;
&lt;Sample("Accordion Playaround sample", DifficultyLevel.Basic), Category("Accordion")&gt; _
Partial Public Class AccordionSample
    Inherits UserControl
    ''' &lt;summary&gt;
    ''' Initializes a new instance of the &lt;see cref="AccordionSample"/&gt; class.
    ''' &lt;/summary&gt;
    &lt;System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Justification:="InitializeComponent Required by Visual Studio.")&gt; _
    Public Sub New()
        InitializeComponent()

        icSelectedIndices.SetBinding(ItemsControl.ItemsSourceProperty, New Binding("SelectedIndices") With {.Source = acc, .Mode = BindingMode.OneWay})

        tbSelectedIndex.SetBinding(TextBox.TextProperty, New Binding("SelectedIndex") With {.Source = acc, .Mode = BindingMode.TwoWay})

        acc.SetBinding(Accordion.SelectedIndexProperty, New Binding("Index") With {.Source = Me, .Mode = BindingMode.TwoWay})

        cbSelectionMode.SelectedItem = cbSelectionMode.Items.OfType(Of ComboBoxItem)().FirstOrDefault(Function(item) item.Content.Equals(acc.SelectionMode.ToString()))

        cbExpandDirection.SelectedItem = cbExpandDirection.Items.OfType(Of ComboBoxItem)().FirstOrDefault(Function(item) item.Content.Equals(acc.ExpandDirection.ToString()))

        cbSelectionSequence.SelectedItem = cbSelectionSequence.Items.OfType(Of ComboBoxItem)().FirstOrDefault(Function(item) item.Content.Equals(acc.SelectionSequence.ToString()))
    End Sub

    ''' &lt;summary&gt;
    ''' Gets or sets the index.
    ''' &lt;/summary&gt;
    ''' &lt;value&gt;The index.&lt;/value&gt;
    Public Property Index() As Integer
        Get
            Return index_Renamed
        End Get
        Set(ByVal value As Integer)
            index_Renamed = value
            tbSelectedIndex.Text = value.ToString(CultureInfo.InvariantCulture)
        End Set
    End Property

    ''' &lt;summary&gt;
    ''' Backingfield for Index.
    ''' &lt;/summary&gt;
    Private index_Renamed As Integer

    ''' &lt;summary&gt;
    ''' Expands the direction changed.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;The sender.&lt;/param&gt;
    ''' &lt;param name="e"&gt;The &lt;see cref="System.Windows.Controls.SelectionChangedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
    &lt;System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification:="Hooked up in Xaml.")&gt; _
    Private Sub ExpandDirectionChanged(ByVal sender As Object, ByVal e As SelectionChangedEventArgs)
        acc.ExpandDirection = CType(System.Enum.Parse(GetType(ExpandDirection), (CType(cbExpandDirection.SelectedItem, ComboBoxItem)).Content.ToString(), True), ExpandDirection)
    End Sub

    ''' &lt;summary&gt;
    ''' Sets the height.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;The sender.&lt;/param&gt;
    ''' &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
    &lt;System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification:="Hooked up in Xaml.")&gt; _
    Private Sub SetHeight(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
        acc.Height = 500
    End Sub

    ''' &lt;summary&gt;
    ''' Removes the height.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;The sender.&lt;/param&gt;
    ''' &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
    &lt;System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification:="Hooked up in Xaml.")&gt; _
    Private Sub RemoveHeight(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
        acc.ClearValue(Control.HeightProperty)
    End Sub

    ''' &lt;summary&gt;
    ''' Selections the mode changed.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;The sender.&lt;/param&gt;
    ''' &lt;param name="e"&gt;The &lt;see cref="System.Windows.Controls.SelectionChangedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
    &lt;System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification:="Hooked up in Xaml.")&gt; _
    Private Sub SelectionModeChanged(ByVal sender As Object, ByVal e As SelectionChangedEventArgs)
        acc.SelectionMode = CType(System.Enum.Parse(GetType(AccordionSelectionMode), (CType(cbSelectionMode.SelectedItem, ComboBoxItem)).Content.ToString(), True), AccordionSelectionMode)
    End Sub

    ''' &lt;summary&gt;
    ''' Selects all.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;The sender.&lt;/param&gt;
    ''' &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
    &lt;System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification:="Hooked up in Xaml.")&gt; _
    Private Sub SelectAll(ByVal sender As Object, ByVal e As RoutedEventArgs)
        acc.SelectAll()
    End Sub

    ''' &lt;summary&gt;
    ''' Unselects all.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;The sender.&lt;/param&gt;
    ''' &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
    &lt;System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification:="Hooked up in Xaml.")&gt; _
    Private Sub UnselectAll(ByVal sender As Object, ByVal e As RoutedEventArgs)
        acc.UnselectAll()
    End Sub

    ''' &lt;summary&gt;
    ''' React to selectionSequence event.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;The sender.&lt;/param&gt;
    ''' &lt;param name="e"&gt;The &lt;see cref="System.Windows.Controls.SelectionChangedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
    &lt;System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification:="Hooked up in Xaml.")&gt; _
    Private Sub SelectionSequenceChanged(ByVal sender As Object, ByVal e As SelectionChangedEventArgs)
        acc.SelectionSequence = CType(System.Enum.Parse(GetType(SelectionSequence), (CType(cbSelectionSequence.SelectedItem, ComboBoxItem)).Content.ToString(), True), SelectionSequence)
    End Sub

    ''' &lt;summary&gt;
    ''' Sets the width.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;The sender.&lt;/param&gt;
    ''' &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
    &lt;System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification:="Hooked up in Xaml.")&gt; _
    Private Sub SetWidth(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
        acc.Width = 300
    End Sub

    ''' &lt;summary&gt;
    ''' Removes the width.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;The sender.&lt;/param&gt;
    ''' &lt;param name="e"&gt;The &lt;see cref="System.Windows.RoutedEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
    &lt;System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification:="Hooked up in Xaml.")&gt; _
    Private Sub RemoveWidth(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
        acc.ClearValue(Control.WidthProperty)
    End Sub
End Class
</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
</src:SourceViewer>
  </StackPanel>
</UserControl>
